#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	char str[30] = { 0 };
	char ch = 0;
	int i = 0;
	int j = 0;
	int m = 0;
	while ((ch = getchar()) != '\n')
	{
		str[i] = ch;
		i++;
	}
	scanf("%d", &m);
	for (j = m - 1; j < i; j++)
	{
		printf("%c", str[j]);
	}
	return 0;
}
